﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/Principal.master" AutoEventWireup="true" CodeFile="NivelDeFormacion.aspx.cs" Inherits="NivelDeFormacion" %>

<%@ Register src="MenusDePagina/WebUserControlMenuConfiguracion.ascx" tagname="WebUserControlMenuConfiguracion" tagprefix="uc1" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
    <style type="text/css">
        .style1
        {
            color: #FFFFFF;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolderMenuDePagina" Runat="Server">
    <uc1:WebUserControlMenuConfiguracion ID="WebUserControlMenuConfiguracion1" 
        runat="server" />
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolderPrincipal" Runat="Server">
    <asp:Panel ID="Panel1" runat="server" HorizontalAlign="Center">
        <asp:Label ID="Label1" runat="server"></asp:Label>
    </asp:Panel>
    <asp:FormView ID="FormViewNivelDeFormacion" runat="server" 
        DataSourceID="ObjectDataSourceNivelDeFormacion" HorizontalAlign="Center" 
        oniteminserted="FormViewNivelDeFormacion_ItemInserted">
        <EditItemTemplate>
            Codigo:
            <asp:TextBox ID="CodigoTextBox" runat="server" Text='<%# Bind("Codigo") %>' />
            <br />
            Nombre:
            <asp:TextBox ID="NombreTextBox" runat="server" Text='<%# Bind("Nombre") %>' />
            <br />
            <asp:LinkButton ID="UpdateButton" runat="server" CausesValidation="True" 
                CommandName="Update" Text="Actualizar" />
            &nbsp;<asp:LinkButton ID="UpdateCancelButton" runat="server" 
                CausesValidation="False" CommandName="Cancel" Text="Cancelar" />
        </EditItemTemplate>
        <InsertItemTemplate>
            <table style="width:100%;">
                <tr>
                    <td bgcolor="#507CD1" colspan="2" align="center" class="style1">
                        Nivel de Formación</td>
                </tr>
                <tr>
                    <td>
                        Nombre:</td>
                    <td>
                        <asp:TextBox ID="NombreTextBox" runat="server" Text='<%# Bind("Nombre") %>' />
                        <asp:RequiredFieldValidator ID="RequiredFieldValidatornombre" runat="server" 
                            ControlToValidate="NombreTextBox" ErrorMessage="Campo Nombre Obligatorio" 
                            ValidationGroup="Validadores">*</asp:RequiredFieldValidator>
                    </td>
                </tr>
                <tr>
                    <td bgcolor="#507CD1" colspan="2">
                        <asp:LinkButton ID="InsertButton" runat="server" CausesValidation="True" 
                            CommandName="Insert" Text="Insertar" ValidationGroup="Validadores" 
                            style="color: #FFFFFF" />
                        <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" 
                            CommandName="Cancel" Text="Cancelar" style="color: #FFFFFF" />
                    </td>
                </tr>
            </table>
            &nbsp;<br />
            &nbsp;<br />
            &nbsp;
        </InsertItemTemplate>
        <ItemTemplate>
            &nbsp;<asp:LinkButton ID="NewButton" runat="server" CausesValidation="False" 
                CommandName="New" Text="Nuevo" />
        </ItemTemplate>
    </asp:FormView>
    <asp:GridView ID="GridViewNivelDeFormacion" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" CellPadding="4" CssClass="detalle" 
        DataKeyNames="Codigo" DataSourceID="ObjectDataSourceNivelDeFormacion" 
        ForeColor="#333333" GridLines="None" HorizontalAlign="Center">
        <RowStyle BackColor="#EFF3FB" />
        <Columns>
            <asp:TemplateField ShowHeader="False">
                <HeaderTemplate>
                    <asp:LinkButton ID="LinkButtonAddNew" runat="server" 
                        onclick="LinkButtonAddNew_Click">Add new</asp:LinkButton>
                </HeaderTemplate>
                <EditItemTemplate>
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="True" 
                        CommandName="Update" Text="Update"></asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                        CommandName="Cancel" Text="Cancel"></asp:LinkButton>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False" 
                        CommandName="Edit" Text="Edit"></asp:LinkButton>
                    &nbsp;<asp:LinkButton ID="LinkButton2" runat="server" CausesValidation="False" 
                        CommandName="Delete" Text="Delete" OnClientClick="javascript:return ConfirmDel(this);"></asp:LinkButton>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="Codigo" HeaderText="Codigo" 
                SortExpression="Codigo" ReadOnly="True" />
            <asp:BoundField DataField="Nombre" HeaderText="Nombre" 
                SortExpression="Nombre" />
        </Columns>
        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
        <EmptyDataTemplate>
            No hay datos asociados a nivel de formación<br />
            <br />
            <asp:LinkButton ID="LinkButtonAddNew" runat="server" 
                onclick="LinkButtonAddNew_Click">Add new</asp:LinkButton>
        </EmptyDataTemplate>
        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
        <EditRowStyle BackColor="#2461BF" />
        <AlternatingRowStyle BackColor="White" />
    </asp:GridView>
    <asp:ObjectDataSource ID="ObjectDataSourceNivelDeFormacion" runat="server" 
        DeleteMethod="eliminarNivelDeFormacion" InsertMethod="crearNivelDeFormacion" 
        SelectMethod="consultarNivelesDeFormacion" 
        TypeName="Libreria.RFID.Negocio.NivelDeFormacionNegocio" 
        UpdateMethod="actualizarNivelDeFormacion" 
        oninserted="ObjectDataSourceNivelDeFormacion_Inserted" 
        ondeleted="ObjectDataSourceNivelDeFormacion_Deleted">
        <DeleteParameters>
            <asp:Parameter Name="Codigo" Type="Int32" />
            <asp:Parameter Name="CadenaDeConexion" Type="String" />
            <asp:Parameter Direction="Output" Name="mensaje" Type="String" />
        </DeleteParameters>
        <UpdateParameters>
            <asp:Parameter Name="Codigo" Type="Int32" />
            <asp:Parameter Name="Nombre" Type="String" />
            <asp:Parameter Name="CadenaDeConexion" Type="String" />
        </UpdateParameters>
        <SelectParameters>
            <asp:SessionParameter Name="CadenaDeConexion" SessionField="CadenaDeConexion" 
                Type="String" />
        </SelectParameters>
        <InsertParameters>
            <asp:Parameter Name="Codigo" Type="Int32" />
            <asp:Parameter Name="Nombre" Type="String" />
            <asp:Parameter Name="CadenaDeConexion" Type="String" />
        </InsertParameters>
    </asp:ObjectDataSource>
</asp:Content>

